<?php

namespace App\Api\Controllers;

use App\Api\Dao\GoodsGroupDao;
use App\Api\Logic\GoodsGroupLogic;
use Illuminate\Http\Request;

class GoodsGroupController extends BaseController
{
    /**
     * 获取套餐商品
     * @return \Illuminate\Http\JsonResponse
     */
    public function getGroupGoods(Request $request,GoodsGroupDao $goodsGroupDao){
        $data = $request->all();
        $result = $goodsGroupDao->getGroupGoods($data);
        return $this->success($result);
    }

    /**
     * 获取套餐详情
     * @param Request $request
     * @param GoodsGroupLogic $goodsGroupLogic
     * @param GoodsGroupDao $goodsGroupDao
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\ValidationException
     */
    public function getGroupGoodsInfo(Request $request,GoodsGroupLogic $goodsGroupLogic,GoodsGroupDao $goodsGroupDao){
        $data = $request->all();
        $goodsGroupLogic->getGroupGoodsInfo($data);
        $result = $goodsGroupDao->getGroupGoodsInfo($data);
        return $this->success($result);
    }
}
